import React from "react";
import PropTypes from 'prop-types';

const Image = props => {
  if (props.post && props.post.image){
    return (
        <img
          className="img-responsive"
          src={`${process.env.REACT_APP_SERVE + props.post.image}`}
          alt="图片丢失"
        />
    )
  }
  return null;
}

Image.propTypes = {
  post: PropTypes.shape({
    image: PropTypes.string,
  })
}

export default Image;
